.class public Lcom/htc/android/footprints/commonui/ListItemDialog;
.super Landroid/app/Dialog;
.source "ListItemDialog.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/htc/android/footprints/commonui/ListItemDialog$DialogListItem;,
        Lcom/htc/android/footprints/commonui/ListItemDialog$ItemListAdapter;
    }
.end annotation


# static fields
.field private static final TAG:Ljava/lang/String; = "ListItemDialog"


# instance fields
.field public mIconList:[I

.field public mItemList:[Ljava/lang/String;

.field mListView:Landroid/widget/ListView;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;I)V
    .locals 6
    .parameter "context"
    .parameter "title"
    .parameter "iconID"

    .prologue
    const/16 v5, 0x8

    .line 30
    invoke-direct {p0, p1}, Landroid/app/Dialog;-><init>(Landroid/content/Context;)V

    .line 32
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->getWindow()Landroid/view/Window;

    move-result-object v3

    new-instance v4, Landroid/graphics/drawable/ColorDrawable;

    invoke-direct {v4}, Landroid/graphics/drawable/ColorDrawable;-><init>()V

    invoke-virtual {v3, v4}, Landroid/view/Window;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 33
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->getWindow()Landroid/view/Window;

    move-result-object v3

    const/4 v4, 0x1

    invoke-virtual {v3, v4}, Landroid/view/Window;->requestFeature(I)Z

    .line 35
    const v3, 0x7f030015

    invoke-virtual {p0, v3}, Lcom/htc/android/footprints/commonui/ListItemDialog;->setContentView(I)V

    .line 36
    const v3, 0x7f0c0074

    invoke-virtual {p0, v3}, Lcom/htc/android/footprints/commonui/ListItemDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    .line 37
    .local v1, titleIcon:Landroid/widget/ImageView;
    const v3, 0x7f0c0075

    invoke-virtual {p0, v3}, Lcom/htc/android/footprints/commonui/ListItemDialog;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 38
    .local v2, titleText:Landroid/widget/TextView;
    const v3, 0x7f0c0076

    invoke-virtual {p0, v3}, Lcom/htc/android/footprints/commonui/ListItemDialog;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/ListView;

    iput-object v3, p0, Lcom/htc/android/footprints/commonui/ListItemDialog;->mListView:Landroid/widget/ListView;

    .line 40
    if-nez p3, :cond_1

    .line 41
    invoke-virtual {v1, v5}, Landroid/widget/ImageView;->setVisibility(I)V

    .line 50
    :cond_0
    :goto_0
    if-nez p2, :cond_2

    .line 51
    invoke-virtual {v2, v5}, Landroid/widget/TextView;->setVisibility(I)V

    .line 56
    :goto_1
    return-void

    .line 44
    :cond_1
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3, p3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    .line 45
    .local v0, drawable:Landroid/graphics/drawable/Drawable;
    if-eqz v0, :cond_0

    .line 46
    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0

    .line 54
    .end local v0           #drawable:Landroid/graphics/drawable/Drawable;
    :cond_2
    invoke-virtual {v2, p2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1
.end method

.method static synthetic access$000(Lcom/htc/android/footprints/commonui/ListItemDialog;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 23
    invoke-direct {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->isResolutionQVGA()Z

    move-result v0

    return v0
.end method

.method private isResolutionQVGA()Z
    .locals 4

    .prologue
    .line 78
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v3, "window"

    invoke-virtual {v2, v3}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/view/WindowManager;

    .line 81
    .local v1, windowMgr:Landroid/view/WindowManager;
    invoke-interface {v1}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v2

    invoke-virtual {v2}, Landroid/view/Display;->getHeight()I

    move-result v0

    .line 83
    .local v0, ScreenHeight:I
    const/16 v2, 0x140

    if-gt v0, v2, :cond_0

    const/4 v2, 0x1

    :goto_0
    return v2

    :cond_0
    const/4 v2, 0x0

    goto :goto_0
.end method


# virtual methods
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
    .locals 3
    .parameter "keyCode"
    .parameter "event"

    .prologue
    .line 66
    const-string v0, "ListItemDialog"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "keyCode = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 67
    const/4 v0, 0x4

    if-ne p1, v0, :cond_0

    .line 68
    invoke-virtual {p0}, Lcom/htc/android/footprints/commonui/ListItemDialog;->dismiss()V

    .line 70
    :cond_0
    invoke-super {p0, p1, p2}, Landroid/app/Dialog;->onKeyDown(ILandroid/view/KeyEvent;)Z

    move-result v0

    return v0
.end method

.method public setListItem([Ljava/lang/String;[I)V
    .locals 2
    .parameter "itemList"
    .parameter "iconList"

    .prologue
    .line 59
    iput-object p1, p0, Lcom/htc/android/footprints/commonui/ListItemDialog;->mItemList:[Ljava/lang/String;

    .line 60
    iput-object p2, p0, Lcom/htc/android/footprints/commonui/ListItemDialog;->mIconList:[I

    .line 62
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ListItemDialog;->mListView:Landroid/widget/ListView;

    new-instance v1, Lcom/htc/android/footprints/commonui/ListItemDialog$ItemListAdapter;

    invoke-direct {v1, p0}, Lcom/htc/android/footprints/commonui/ListItemDialog$ItemListAdapter;-><init>(Lcom/htc/android/footprints/commonui/ListItemDialog;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 63
    return-void
.end method

.method public setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V
    .locals 1
    .parameter "l"

    .prologue
    .line 74
    iget-object v0, p0, Lcom/htc/android/footprints/commonui/ListItemDialog;->mListView:Landroid/widget/ListView;

    invoke-virtual {v0, p1}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 75
    return-void
.end method
